/* eslint valid-jsdoc: "off" */

'use strict';

/**
 * @param {Egg.EggAppInfo} appInfo app info
 */
module.exports = appInfo => {
   /**
    * built-in config
    * @type {Egg.EggAppConfig}
    **/
   const config = {};

   // use for cookie sign key, should change to your own and keep security
   config.keys = appInfo.name + '_1550561418886_728';

   // add your middleware config here
   config.middleware = [];

   config.sequelize = { // egg-sequelize 配置
      dialect: "mysql", // db type
      dialectOptions: {
         charset: 'utf8mb4',
      },
      database: "sales",
      host: "127.0.0.1",
      port: "3306",
      username: "root",
      password: "123456",
      timezone: '+08:00',
   };

   config.security = {
      csrf: {
         enable: false,
      },
      domainWhiteList: [ 'http://localhost' ],
   };
   /**
    * 模板文件
    * @type {{defaultViewEngine: string, mapping: {".tpl": string}}}
    */
   config.view = {
      defaultViewEngine: 'nunjucks',
      mapping: {
         '.tpl': 'nunjucks'
      }
   };

   // add your user config here
   const userConfig = {
      // myAppName: 'egg',
   };

   return {
      ...config,
      ...userConfig,
   };
};
